<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<c:set var="serviceurl" value="${ctx}/pro/asset" />
<div class="rap-page-area" id="rap-view-asset">
	<div class="col-md-12 rap-layout-main">
		<div class="row rap-toolbar">
			<button id="rap-btn-close">
				<i class="fa fa-times"></i> 关闭
			</button>
		</div>
		<div class="row">
			<!-- Detail From -->
			<form id="rap-form-detail" class="rap-form rap-form-detail">
				<table>
					<tr>
						<td class="rap-form-lable">所属物业</td>
						<td>
	<input type="text" name="property.theName" readonly >
						</td>
						<td class="rap-form-lable">资产名称</td>
						<td>
	<input name="theName" type="text" readonly>
						</td>
						<td class="rap-form-lable">资产面积(m²)</td>
						<td>
	<input name="area" type="text" readonly>
						</td>
					</tr>
					<tr>
						<td class="rap-form-lable">区域</td>
						<td>
	<select class="rap-input-enumdata" name="region" data-enum-group="stwy_region" disabled="disabled"></select>
						</td>
						<td class="rap-form-lable">一级组别</td>
						<td>
	<select class="rap-input-enumdata" name="groupOne" data-enum-group="stwy_groupOne" disabled="disabled"></select>
						</td>
						<td class="rap-form-lable">二级组别</td>
						<td>
	<select class="rap-input-enumdata" name="groupTwo" data-enum-group="stwy_groupTwo" disabled="disabled"></select>
						</td>
					</tr>
					<tr>
						<td class="rap-form-lable">用途</td>
						<td>
	<select class="rap-input-enumdata" name="usefor" data-enum-group="stwy_usefor" disabled="disabled"></select>
						</td>
						<td class="rap-form-lable">位置</td>
						<td>
	<input name="address" type="text" readonly>
						</td>
						<td class="rap-form-lable">房产证号</td>
						<td>
	<input name="houseCert" type="text" readonly>
						</td>
					</tr>
					<tr>
						<td class="rap-form-lable">备注</td>
						<td colspan="5">
    <textarea name="remark" data-maxlength="2000" maxlength="2000" readonly="readonly"></textarea>
						</td>
					</tr>
				</table>
			</form>
		</div>
	</div>
</div>
<script>
//宏：生成ShowData方法，在编辑框显示记录数据
function showData(data) {
	$("input[name='uuid']").val(data.uuid);
	$("input[name='theCode']").val(data.theCode);
	$("input[name='theName']").val(data.theName);
	$("input[name='assetState']").val(data.assetState);
	$("input[name='area']").val(data.area);
	$("select[name='region']").val(data.region);
	$("select[name='usefor']").val(data.usefor);
	$("select[name='groupOne']").val(data.groupOne);
	$("select[name='groupTwo']").val(data.groupTwo);
	$("input[name='houseCert']").val(data.houseCert);
	$("input[name='address']").val(data.address);
	$("textarea[name='remark']").val(data.remark);
	$("input[name='property.uuid']").val(data.property.uuid);
	$("input[name='property.theName']").val(data.property.theName);
	$("input[name='propertyName']").val(data.property.theName);
}
function getAssetInfo(uuid){
	$.ajax({
		url : '${serviceurl}/query',
		data : {"search_EQ_uuid":uuid},
		dataType : 'json',
		success : function(data) {
			showData(data.records[0]);
		}
	});
}
$(document).ready(function() {
	var uuid = '${param.uuid}';
	getAssetInfo(uuid);
	$("#rap-btn-close").click(function() {
		window.parent.$.colorbox.close();
	});
});
</script>